﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MpSoft.Web
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.CacheControl = "private";
            Response.Expires = 0;
            Response.AddHeader("pragma", "no-cache");
            var user = MpSoft.Basic.Configuration.MpContext.Current.User;
            if (user != null)
                Response.Write(user.Email);

        }

        protected void OnLoggedIn(object sender, EventArgs e)
        {
            string str = string.Empty;
            str = Page.Request.QueryString["ReturnUrl"];
            if (string.IsNullOrEmpty(str))
                str = "/AdminCP/";
            if (str.ToLower().Contains(".aspx"))
                str = str.Replace(".aspx", ".html");
            //Response.Write(str);
            this.LoginForm.DestinationPageUrl = str;
        }
    }
}